#include "servernntp.h"
#include <stdlib.h>
#include <signal.h>

ServerNNTP server;

void my_handler(int s)
{
	cout << endl << "Server got signal: " << s << ", cleaing up..." <<  endl;
	server.destroy();
     	exit(1); 
}

int main()
{
	struct sigaction sigIntHandler;

	sigIntHandler.sa_handler = my_handler;
	sigemptyset(&sigIntHandler.sa_mask);
	sigIntHandler.sa_flags = 0;
	sigaction(SIGINT, &sigIntHandler, NULL);

	server.run();

	return 0;
}
